<?php
class WxmenuModel extends CommonModel {
	public function getall($map) {
		$map['pid'] = 0;
        $list   =   $this->where($map)->order('ind asc')->select();
        $vlist = array();
        foreach($list as $v){
        	$map['pid'] = $v['id'];
            $sub = $this->where($map)->order('ind asc')->select();
            $v['item'] = $sub ;
            $vlist[] = $v;
        }
        return $vlist;
    }

    public function getwxall($map) {
        $map['pid'] = 0;
        $map['name'] = array('neq','');
        $list   =   $this->where($map)->order('ind asc')->select();
        $vlist = array();
        foreach($list as $v){
            $map['pid'] = $v['id'];
            $map['name'] = array('neq','');
            $sub = $this->where($map)->order('ind asc')->select();
            $v['item'] = $sub ;
            $vlist[] = $v;
        }
        return $vlist;
    }
}